#ifndef _NAT_H_
#define _NAT_H_
/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdarg.h>
#include "rilConfig.h"
/* typedef -------------------------------------------------------------------*/

struct NatResponse
{
    char buf[RIL_AT_RESPONSE_COUNT][32];
	uint8_t counter;
};
struct NatAdapter
{
    int     (*write)(void *buf, size_t size);
    int     (*read)(void *buf, size_t size);
    int    	(*pinCtrl)(int pinId, int level);		// if level < 0, pinCtrl is read pin level
	int		(*power)(int mode);						// 0 power off 1 power on
    struct NatResponse  response;
};

struct NatUrc
{
    const char *prefix;
    int (*handle)(char *data);
}; 


struct Nat
{
    const struct NatUrc       *urcs;       // (Unsolicited Result Code) list     
};
/* define --------------------------------------------------------------------*/
/* macro ---------------------------------------------------------------------*/
/* variables -----------------------------------------------------------------*/
/* function prototypes -------------------------------------------------------*/
int _Nat_ExecuteCommand(struct NatAdapter *adapter, struct Nat *at, int32_t waitTime, char *response, char *format, va_list args);
int Nat_SendRaw(struct NatAdapter *adapter, struct Nat *at, int32_t waitTime, char *response, uint8_t *packet, size_t size);
int Nat_ExecuteCommand(struct NatAdapter *adapter, struct Nat *at, int32_t timeout, char *response, char *fomart, ...);
char* Nat_ResponseCheck(struct NatResponse *response, char *matchString);

/* functions -----------------------------------------------------------------*/
#endif
